﻿using Models;
using Newtonsoft.Json;
using Server.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Server.Controllers
{
    public class HomeController : Controller
    {
        private DatabaseContext db = new DatabaseContext();

        public ActionResult Index()
        {
            var lst = db.TaiXe.ToList();

            ViewBag.Json = JsonConvert.SerializeObject(lst);
            var xyz = JsonConvert.DeserializeObject<List<TaiXe>>(ViewBag.Json);
            return View();
        }

    }
}
